/*
 * @(#) PagerableAction.java 2010-9-9
 *
 * Copyright (c) 2010, Strong Technology. All Rights Reserved.
 * Strong Technology. CONFIDENTIAL
 */
package cn.strong.gweva.common.presentation.action;

/**
 * 分页画面的基类Action
 * 
 * @author lilanfei
 * @version 1.0
 * @since 2010-9-9
 */
public class PagerableAction extends BaseAction
{
	/**
	 * 
	 */
	private static final long serialVersionUID = -7979850882020596195L;

	// 当前页
	protected String page = "0";

	// 总件数
	protected String totalCount = "0";

	// 每页显示行数
	protected String pageRows = "10";

	/**
	 * @return pageRows
	 */
	public String getPageRows()
	{
		return this.pageRows;
	}

	/**
	 * @param pageRows pageRows
	 */
	public void setPageRows(String pageRows)
	{
		this.pageRows = pageRows;
	}

	/**
	 * @return totalCount
	 */
	public String getTotalCount()
	{
		return this.totalCount;
	}

	/**
	 * @param totalCount totalCount
	 */
	public void setTotalCount(String totalCount)
	{
		this.totalCount = totalCount;
	}

	/**
	 * @return page
	 */
	public String getPage()
	{
		return page;
	}

	/**
	 * @param page page
	 */
	public void setPage(String page)
	{
		this.page = page;
	}

	/**
	 * 
	 * @return
	 */
	protected int getCurrentStartRow()
	{
		int pageInt = Integer.parseInt(page);
		int pageRowsInt = Integer.parseInt(pageRows);
		int currentStartRow = 0;
		if (pageInt != 0)
		{
			currentStartRow = (pageRowsInt * (pageInt - 1));
		}
		return currentStartRow;
	}
}
